<!-- list game category -->

<div class="Playgame">
  <p class="header">&nbsp;</p>
  <div class="Playgame-header">
    <ul class="breakcrum">
      <li><strong><a href="/trang-chu.html" title="Trang chủ">Trang chủ</a></strong></li>
      <li><strong><a href="/danh-muc-game/<?php echo $category_info['id']; ?>-<?php echo $category_info['alias']; ?>.html" title="<?php echo $category_info['title']; ?>"><?php echo $category_info['title']; ?></a></strong></li>
      <li><?php echo $content['Game']['title']; ?></li>
    </ul>
    <div class="game-title">
        <h1>Game <?php echo $content['Game']['title']; ?></h1>
        <div class="like-facebook">
        </div>
    </div>

    <p class="playfullscreen">
        <a href="javascript:void(0);" onclick="show_fullscreen()">[Click vào đây để chơi game ở chế độ màn hình chuẩn hơn]</a>
    </p>

  </div>
  <div class="Playgame-content">
    <div class="embed-game">
    <?php if($content['Game']['content_type'] == 'swf'): ?>
      <div id="show_game">
        <img src="/img/flash_loader_v1.jpg" width="528px" height="550px" alt="flash loader" />
        <?php echo $content['Game']['description']; ?>
      </div>
      <script language="javascript" type="text/javascript">
		var params = {
			quality: "high",
			scale: "noscale",
			wmode: "transparent",
			allowscriptaccess: "always",
			allowFullScreen: "true",
			allownetworking: "all",
			bgcolor: "#000000"
		};

            swfobject.embedSWF('<?php echo $flash_url_path; ?>', "show_game", "610", "550", "<?php echo $content['Game']['flash_version']; ?>","/img/expressInstall.swf", null, params, false);
      </script>
      <?php endif; ?>
      <?php if($content['Game']['content_type'] == 'html'): ?>
        <?php echo $content['Game']['html_content']; ?>
      <?php endif; ?>
      <?php if($content['Game']['content_type'] == 'dcr'): ?>
        <object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://active.macromedia.com/director/cabs/sw.cab#version=6,0,1,0" width="610px" height="550px">
            <param name="SRC" value="<?php echo $flash_url_path; ?>">
            <param name="swRemote" value="swTarget='false'">
            <embed src="<?php echo $flash_url_path; ?>" pluginspage="http://www.macromedia.com/shockwave/download/" type="application/x-director" width="610px" height="550px" swRemote="swTarget='false'">
            </embed>
        </object>
      <?php endif; ?>
      <div class="game-content">
        
        <div class="add-favourite">
            <a href="javascript:void(0);" title="thêm vào danh sách game yêu thích" onclick="add_game_to_favourite('<?php echo '/' . $content['Game']['folder_url'] . $content['Game']['thumbnail']; ?>', '<?php echo $content['Game']['title']; ?>', '/choi-game/<?php echo $content['Game']['id'] . '-'  . $content['Game']['alias']; ?>.html', '<?php echo $content['Game']['id']; ?>');"><img src="/img/add-favourite2.png" alt="add game vào danh sách yêu thích" width="80px" height="20px" /></a>
        </div>
        <div class="goto-comment">
            <?php if($login_status){ ?>
            <a href="javascript:void(0);" title="Comment cho game này nhé" onclick="$.scrollTo('#your-comment-input', 800);"><img src="/img/comment-icon.png" alt="Comment cho game này nhé" width="80px" height="20px" /></a>
            <?php }else{ ?>
            <a href="javascript:void(0);" title="Đăng nhập để comment nha bạn" onclick="showPopupLogin();"><img src="/img/comment-icon.png" alt="Đăng nhập để comment nha bạn" width="80px" height="20px" /></a>
            <?php } ?>
        </div>
        <div class="list-share-icon"> <span>Chia sẻ:</span>
          <ul>
            <li>
                <a title="share lên tường nhà facebook" target="_blank" href="http://www.facebook.com/sharer.php?u=<?php echo $this->Html->url("/choi-game/{$content['Game']['id']}-{$content['Game']['alias']}.html", true); ?>&amp;t=<?php echo $content['Game']['title']; ?>" onclick="javascript:window.open(this.href,
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=800,width=700');return false;"><img src="/img/facebook-share-icon.png" width="22px" height="22px" alt="icon facebook" /></a>
            </li>
            <li>
                <a title="share lên tường nhà zingme" target="_blank" href="http://link.apps.zing.vn/share?u=<?php echo $this->Html->url("/choi-game/{$content['Game']['id']}-{$content['Game']['alias']}.html", true); ?>&amp;t=chơi game <?php echo $content['Game']['title']; ?> tại www.thegioigamevui.com&amp;desc=Cùng chơi game <?php echo $content['Game']['title']; ?>. www.thegioigamevui.com luôn cung cấp những game hay nhất cho bạn những phút giây thư giãn sau giờ làm việc, học tập căng thẳng&amp;images=<?php echo $flash_thumbnail; ?>&amp;media=<?php echo $flash_url_path; ?>&amp;width=610&amp;height=550" onclick="javascript:window.open(this.href,
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
                    <img src="/img/zingme-share-icon.png" alt="icon zingme" width="22px" height="22px" />
                </a>
            </li>
            <li><a title="share lên tường nhà google+" href="https://plus.google.com/share?url=<?php echo $this->Html->url("/choi-game/{$content['Game']['id']}-{$content['Game']['alias']}.html", true); ?>" onclick="javascript:window.open(this.href,
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">

            <img src="/img/googleplus-share-icon.png" width="38px" height="22px" alt="icon google+"/>
            </a>
            </li>
            <li><a target="_blank" title="share lên tường nhà twitter" href="https://twitter.com/intent/tweet?original_referer=<?php echo $this->Html->url("/choi-game/{$content['Game']['id']}-{$content['Game']['alias']}.html", true); ?>&amp;source=tweetbutton&amp;text=chơi game <?php echo $content['Game']['title']; ?> tại www.thegioigamevui.com&amp;via=twitterapi" onclick="javascript:window.open(this.href,
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img src="/img/twitter-share-icon.png" alt="Goonline" /></a></li>
            <li><a title="share lên tường nhà banbe.net" target="_blank" href="http://plugins.banbe.net/share/post?href=<?php echo $this->Html->url("/choi-game/{$content['Game']['id']}-{$content['Game']['alias']}.html", true); ?>&amp;title=chơi game <?php echo $content['Game']['title']; ?> tại www.thegioigamevui.com&amp;feed_img=<?php echo $flash_thumbnail; ?>" onclick="javascript:window.open(this.href,
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img src="/img/banbe-share-icon.png" alt="banbe.net" /></a></li>
          </ul>
        </div>
        <!--
        <div class="report-badlink">
            <a href="javascript:void(0)" onclick="report_badlink('<?php echo $content['Game']['id']; ?>');" title="báo game lỗi">
            <img src="/img/error_games_report.png" width="22px" height="19px" alt="báo game lỗi"/>
            Nếu game lỗi xin vui lòng click vào đây để báo cho người quản trị được biết
            </a>
        </div>
        -->
      </div>
    </div>
        <div class="faq-links">
            <?php if($content['Game']['group_id']==1){ ?>
            <a target="_blank" href="http://thegioigamevui.com/doc-bai-viet/1-Huong-dan-cai-dat-Flash-player-moi-nhat.html" title="Hướng dẫn cài đặt flash player">[Nếu không chơi được game Click vào đây để cài đặt flash player]</a>
            <?php }else{ ?>
            <a target="_blank" href="http://thegioigamevui.com/doc-bai-viet/2-Huong-dan-cai-dat-Shockwave-moi-nhat.html" title="Hướng dẫn cài đặt Shockwave ">[Nếu không chơi được game Click vào đây để cài đặt Shockwave]</a>
            <?php } ?>
        </div>
    <div class="add-my-favourite">
        <a href="javascript:void(0);" title="thêm vào danh sách game yêu thích" onclick="add_game_to_favourite('<?php echo '/' . $content['Game']['folder_url'] . $content['Game']['thumbnail']; ?>', '<?php echo $content['Game']['title']; ?>', '/choi-game/<?php echo $content['Game']['id'] . '-'  . $content['Game']['alias']; ?>.html', '<?php echo $content['Game']['id']; ?>');">[Thêm game này vào danh sách game yêu thích của bạn]</a>
    </div>
    <div class="game-description">
      <h3>Giới thiệu và hướng dẫn chơi game</h3>
      <div class="content">
        <?php echo $content['Game']['description']; ?>
      </div>
    </div>
    <div class="tags-content"> <img src="/img/tags-content-icon.png" alt="Nội dung game" width="40px" height="34px"  />
      <p><?php echo $content['Game']['tags_html']; ?> </p>
    </div>
    <!-- comment block -->
    <div class="comment-block">        
        <h3>Bình luận về game này</h3>
        <div class="comment-body">
            <?php if($login_status){ ?>
            <!-- form post comment-->
            <?php echo $this->Form->create('Comment', array('name' => 'frmComment', 'id' => 'frmComment', 'class' => 'blockInfo', 'url' => array('controller' => 'comments', 'action' => 'post'))); ?>
            <div class="comment-form">
                <div class="posting-avatar">
                    <img src="/img/no-avatar.jpg" height="50px" width="50px" alt="no avatar" />
                    <strong><?php echo $user['User']['fullname']; ?></strong>
                </div>
                <div class="posting-avatar-form">
                    <p>
                        <?php echo $this->Form->textarea('your-comment', array('onfocus' => 'comment_clearContent(this);','clear' => '0','rows'=> '4','cols' => '55','id'=>'your-comment-input','value'=> 'Nhập ý kiến của bạn chọ game này')); ?>
                    </p>
                    <p>
                        <input type="button" class="comment-btsend" name="btsend" value="Đăng ý kiến" onclick="submit_comment();" />
                    </p>
                </div>
            </div>
            <?php echo $this->Form->hidden('game_id', array('value'=> $content['Game']['id'])); ?>
            <?php echo $this->Form->end(); ?>
            <!-- end form post comment-->
            <?php }else { ?>
            <p class="comment-nologin">Hãy <a class="login" href="javascript:void(0);" title="Đăng nhặp" onclick="showPopupLogin();">Đăng nhập</a> để bình luận cho game này nhé!</p>
            <?php } ?>
            <!-- list comment-->
            <?php 
				$row_index_bg	=	1;
				 ?>
            <div class="comment-list">
                <a name="list-comment"></a>
                <?php foreach($data_comments AS $comment_row): ?>
                <div class="comment-rows bg<?php echo $row_index_bg; ?>">
                    <img src="/img/no-avatar.jpg" height="50px" width="50px" alt="no avatar" />
                    <div class="comment-rows-content">
                        <p><strong><?php echo $comment_row['Comment']['fullname']; ?></strong><span>Gởi lúc <?php echo $comment_row['0']['Comment.created']; ?></span></p>
                        <p class="comment-content">
                            <strong><?php echo $comment_row['Comment']['content']; ?></strong>
                        </p>
                    </div>
                </div>
                <?php 
				$row_index_bg	=	3 - $row_index_bg;
				endforeach; ?>
            </div>
            <?php echo $this->element('paging', array('paging' => $this->Paginator)); ?>
            
            <!-- end list comment-->
        </div>
    </div>
    <!-- end comment block -->
  </div>
  <p class="Playgame-footer"></p>
</div>
<?php if(isset($otherGames[0])): ?>
<div class="Playgame otherGame">
  <p class="header">&nbsp;</p>
  <div class="Playgame-header">
    <p class="title">Game khác cùng thể loại</p>
    <p class="ListGame-view-all"> <span><img src="/img/arrow-small-icon.gif" alt="xem tất cả" width="3px" height="6px" /></span> <span><img src="/img/arrow-small-icon.gif" width="3px" height="6px" alt="xem tất cả" /></span> <a href="/danh-muc-game/<?php echo $category_info['id']; ?>-<?php echo $category_info['alias']; ?>.html" title="Xem tất cả">Xem Tất cả</a> </p>
  </div>
  <div class="ListGame ListGameotherGame">
    <div class="ListGame-content">
      <?php
        $i = 1;
        foreach($otherGames AS $row):
            $link_url   =   "/choi-game/{$row['Game']['id']}-{$row['Game']['alias']}.html";
            $thumbnail  = Configure::read('game_flash_thumbnail_url_path'). $row['Game']['folder_url'] . $row['Game']['thumbnail'];
            if($i % 4 == 1){
                echo '<div class="list-game-row">';
                echo '<ul>';
            }
        ?>
          <li>
            <p class="game-thumb">
                        <?php if($row['Game']['hot_icon']): ?>
                        <img class="hot-icon" width="31px" height="32px" alt="Game hot" src="/img/icon-hot.png" />
                        <?php endif; ?>
            <a title="<?php echo $row['Game']['title']; ?>" href="<?php echo $link_url; ?>"><img width="100px" height="80px" alt="<?php echo $row['Game']['title']; ?>" src="<?php echo $thumbnail; ?>" /></a></p>
            <p class="game-detail"> <strong><a title="<?php echo $row['Game']['title']; ?>" href="<?php echo $link_url; ?>"><?php echo $row['Game']['title']; ?></a></strong> <span>Đã chơi: <?php echo $row['Game']['play_times']; ?></span> </p>
          </li>
        <?php
            if($i % 4 == 0 || $i == sizeof($otherGames)){
                echo '</ul>';
                echo '</div>';
            }
            $i++;
            endforeach;
      ?>
    </div>
  </div>
  <?php endif; ?>
  <p class="Playgame-footer">&nbsp;</p>
</div>
